home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 March / PCWorld_2007-03_cd.bin / komunikace / acehtml / acehtmlfreeware.exe / scriptdef / Simple Calculator.sd < prev    next >
INI File  |  2006-09-13  |  1KB  |  56 lines

  1. [SUBJECT]
  2. Description=5 function calculator
  3. ImageIndex=-1
  4. Folder=Mathematics
  5.  
  6.  
  7. [HEAD_TEXT]
  8. ;<script language="JavaScript">
  9. ;<!-- 
  10. ;function a_plus_b(form) {
  11. ;a=eval(form.a.value);
  12. ;b=eval(form.b.value);
  13. ;c=a+b;
  14. ;form.ans.value = c;
  15. ;}
  16. ;function a_minus_b(form) {
  17. ;a=eval(form.a.value);
  18. ;b=eval(form.b.value);
  19. ;c=a-b;
  20. ;form.ans.value=c;
  21. ;}
  22. ;function a_times_b(form) {
  23. ;a=eval(form.a.value);
  24. ;b=eval(form.b.value);
  25. ;c=a*b;
  26. ;form.ans.value=c;
  27. ;}
  28. ;function a_div_b(form) {
  29. ;a=eval(form.a.value);
  30. ;b=eval(form.b.value);
  31. ;c=a/b;
  32. ;form.ans.value = c;
  33. ;}
  34. ;function a_pow_b(form) {
  35. ;a=eval(form.a.value);
  36. ;b=eval(form.b.value);
  37. ;c=Math.pow(a, b);
  38. ;form.ans.value = c;
  39. ;}
  40. ;</script>
  41.  
  42.  
  43. [BODY_TEXT]
  44. ;<div align="center">
  45. ;<form name="formx"><input type="text" size="4" value="12" name="a"> 
  46. ;<input type="button" value="  +  " onClick="a_plus_b(this.form)">áá
  47. ;<input type="button" value="  -  " onClick="a_minus_b(this.form)">áá
  48. ;<input type="button" value="  x  " onClick="a_times_b(this.form)">áá
  49. ;<input type="button" value="  /  " onClick="a_div_b(this.form)">áá
  50. ;<input type="button" value="  ^  " onClick="a_pow_b(this.form)">áá
  51. ;<input type="number" size="4" value="3" name="b"> = <input type="number" value="0" name="ans" size="9">
  52. ;</form>
  53. ;</div>
  54.  
  55.  
  56.